<!-- 审核列表 -->
<template>
  <div class="audit-list-wp" v-loading="_d.loading">
  	<el-card class="full-table" shadow="hover" style="margin-top: 8px">
  		<div class="flex justify-end mb-15">
  			<el-button type="primary" icon="ele-Search" @click="handleQuery"> 查询 </el-button>
  		</div>
			<el-table :data="_d.list" style="width: 100%" border>
				<el-table-column type="index" label="序号" width="55" align="center" />
				<el-table-column prop="projectName" label="项目名称" show-overflow-tooltip />
				<el-table-column prop="phaseName" label="阶段名称" show-overflow-tooltip />
				<el-table-column prop="formName" label="表单名称" show-overflow-tooltip />
				<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip>
					<template #default="scope">
						<el-button size="small" text type="primary" @click="toAuditForm(scope.row)">去审核</el-button>
					</template>
				</el-table-column>
			</el-table>
		</el-card>
  </div>
</template>

<script setup>
	import { reactive, ref, onMounted } from 'vue'
	import {useRouter} from "vue-router";
	import {$get, $post, $postparams} from '/@/utils/request';

	const router = useRouter();

	const _d = reactive({
		loading: false,
		list: []
	})

	onMounted(() => {
		handleQuery();
	})

	// 查询操作
	const handleQuery = async () => {
		_d.loading = true;
		var res = await $get('/projectService/getauditforms');
		_d.list = res.result.map(item => {
			item.formName = item.form.formName;
			return item;
		});
		_d.loading = false;
	};

	// 去审核
	const toAuditForm = row => {
		localStorage.setItem('audit_form_id', row.form.id);
		router.push({
			path: '/ProjectManage/auditForm'
		})
	}

</script>

<style lang="scss" scoped>
.audit-list-wp {

}
</style>